import javax.swing.*;
import javax.swing.undo.*;
import java.awt.event.*;
import java.io.*;

final class RedoItem extends AbstractAction{
  private final Doer frame;
  RedoItem(String name,Doer frame){
    super(name);
    this.frame=frame;
    putValue(SHORT_DESCRIPTION,name);
    String iconFileName="images"+File.separator+name+".gif";
    if(new File(iconFileName).exists())putValue(SMALL_ICON,new ImageIcon(iconFileName));
  }
  public void actionPerformed(ActionEvent e){
    redoFile();
  }
  public void redoFile(){
    InterWindow interWindow=(InterWindow)(frame.getTab().getComponentAt(frame.getSelect()));
    if(interWindow.getDo()!=null){
      try{
        interWindow.getDo().redo();
      }
      catch(CannotRedoException e){}
    }
  }
}
